<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar"><span class="color_red">*</span>中心信息</div>
	<table class="t_css" width="100%" border="0" cellpadding="0"
	    cellspacing="1" id="information">
	<col style="width: 20%"/>
	<col style="width: 15%"/>
	<col style="width: 20%"/>
	<col style="width: 18%"/>
	<col style="width: 27%"/>
	    <tr>
	        <td align="right">中心名称：</td>
	        <td colspan="4">
	        	<input type='text' name='proposal/zh_title' id='zh_title' style="width: 80%" class="input_css required maxlength:100" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="中心名称">
	        </td>
	    </tr>

	     <tr>
	        <td align="right">依托单位：</td>
	        <td colspan="4">
	       		 <span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_name"/></span>
	        </td>
	    </tr>
	     <tr>
             <td align="right">归口管理部门：</td>
             <td colspan="2">
                 <c:set var="recomend_org"> {'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />', 'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />' } </c:set>
                 <cpt:tree id="recomend_org" key="recommended_org"  cacheable="false" className="hn_iuput_kuang required selectWidth3" readonly="true" value="${recomend_org}" label="归口管理部门"
                           showPattern="all" shieldPattern="0" onClick="initTreeValue2">
                 </cpt:tree>
                 <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" >
                 <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
             </td>
             <td  align="right" >申报日期：</td>
             <td>
                 <c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
                 <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
             </td>
        </tr>
	    <tr>
			<td rowspan="4" align="right">中心负责人：</td>
			<td align="right">姓名：</td>
			<td>
				<span name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
			</td>
			<td align="right">学历：</td>
			<td>
				<span name="proposal/fzr_educate_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/educate_name" /></span>
			</td>

	    </tr>
	    <tr>

			<td align="right">职称：</td>
			<td>
				<span name="proposal/contact_prof_title_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
			</td>
			<td align="right">联系电话：</td>
			<td >
				<span name="proposal/fzr_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
			</td>
        </tr>
	    <tr>
			<td align="right">工作单位：</td>
			<td >
				<span name="proposal/fzr_org_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/org_name" /></span>
			</td>

			<td align="right">E-mail：</td>
			<td>
				<span name="proposal/fzr_email"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
			</td>
	    </tr>
	    <tr>
            <td align="right">通讯地址：</td>
            <td>
				<span name="proposal/fzr_address"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/address"/></span>
            </td>
            <td align="right">邮编：</td>
            <td>
				<span name="proposal/fzr_post_code"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/post_code"/></span>
            </td>
	    </tr>

		<tr >
			<td align="right">中心完成情况：</td>
			<td colspan="5">
				<c:set var="expect_value"><x:out select="$xmlData/data/proposal/expect_value" /></c:set>
				<cpt:checkbox key="expect2"  name="expect"  width="25%"  repeatColumn="3" value="${expect_value }"  tagType="radio" ></cpt:checkbox>
				<input type="hidden" id="expect_value" name="proposal/expect_value" class="required" value="${expect_value}" label="中心完成情况"/>
				<input type="hidden" name="proposal/expect_name" value="<x:out select="$xmlData/data/proposal/expect_name" />"/>
			</td>
		</tr>

		<tr>
			<td align="right">建设开始日期：</td>
			<td colspan="2">
				<c:set var="start_date">
					<x:out select="$xmlData/data/proposal/start_date" />
				</c:set>
				<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date   dateCompare:end_date " label="建设开始日期"></cpt:date>
			</td>
			<td align="right">建设结束日期：</td>
			<td >
				<c:set var="end_date">
					<x:out select="$xmlData/data/proposal/end_date" />
				</c:set>
				<cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date " label="建设结束日期"></cpt:date>
			</td>
		</tr>

	</table>

<div class="t_bar">疾病研究协同网络参加单位（限14行）</div>
<table id="inland" border="0" cellspacing="0" cellpadding="0" style="width: 100%" class="table01 t_css">
	<thead>
	<tr>
		<th align="center" width="8%">选择</th>
		<th align="center" width="12%">序号</th>
		<th align="center" width="91%">单位名称</th>

	</tr>
	</thead>
	<tbody id="inland_tab">
	<tr style="display: none" align="center">
		<td align="center">
			<input type="radio" class="radiobutton" name="selAttendOrg11">
		</td>
		<td align="center">
			<span name="inlands|inland[0]@seq_no">[index]</span>
		</td>
		<td align="center">
			<input name="inlands|inland[0]|org_name" label="单位名称" type="text" required onchange="setCooperationUnits();" class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
		</td>

	</tr>
	<c:set value="0" var="index" scope="page" />
	<x:forEach select="$xmlData/data/inlands/inland" var="inland">

		<c:choose>
			<c:when test="${index<10}">
				<c:set value="0" var="flag" scope="page" />
			</c:when>
			<c:otherwise>
				<c:set value="" var="flag" scope="page" />
			</c:otherwise>
		</c:choose>
		<tr align="center">
			<td>
				<input type="radio" class="radiobutton" name="selAttendOrg11">
			</td>
			<td align="center">
					<span name="inlands/inland[${flag}${index}]@seq_no">
						<x:out select="$inland/@seq_no" />
					</span>
			</td>
			<td>
				<input name="inlands/inland[${flag}${index}]/org_name" label="单位名称" type="text" required onchange="setCooperationUnits();" class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
					   value="<x:out select="$inland/org_name" />" />
			</td>
		</tr>
		<c:set var="beggerClass"></c:set>
		<c:set value="${index+1}" var="index" scope="page" />
	</x:forEach>
	</tbody>
</table>
<table width="98%" class="not_table">
	<tr>
		<td>
			<input class="button_02" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('inland',14,'疾病研究协同网络参加单位最多只能填写14条')){addNewRow('inland');}try{top.resizeFrame();}catch(e){};setCooperationUnits();changeCss()" />
			<input class="button_02" name="cmdMovePrev" type="button" value="上移" onclick="movePrev('inland');setCooperationUnits();changeCss()" />
			<input class="button_02" name="cmdMoveNext" type="button" value="下移" onclick="moveNext('inland');setCooperationUnits();changeCss()" />
			<input class="button_02" name="cmddel" type="button" value="删除" onclick="deleteSelectedRow('inland','疾病研究协同网络参加单位');setCooperationUnits();changeCss()" />
		</td>
	</tr>
</table>
<input type="hidden" name="proposal/cooperation_units" id="cooperation_units" value="<x:out select='$xmlData/data/proposal/cooperation_units'/>"/>


<script type="text/javascript">
function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
 }

function setCooperationUnits(){
	var cooperation_units="";
	$("#inland tr:gt(1)").each(function(index){
		var cooperation_unit = $(this).find("td:eq(2) input").val().trim();
		var orgName = $("#org_name").val();
		if(!isBlankOrNull(cooperation_unit) && cooperation_unit!=orgName){
			cooperation_units += cooperation_unit+",";
		}
	});
	if(cooperation_units!=""){
		cooperation_units=cooperation_units.substring(0,cooperation_units.length-1);
	}
	$("#cooperation_units").val(cooperation_units);
}

function changeCss() {
	$("table.t_css").each(function(){
		$(this).find("tr:even").removeClass().addClass("li_1");
		$(this).find("tr:odd").removeClass().addClass("li_2");
	});
}
</script>	